package _4ChapterFore._6ReplaceConditionalWithPolymorphism.oldProject;

public class Employee {
    public static final int MANAGER = 0;

    public static final int ENGINEER = 1;

    public static final int SALESMAN = 2;

    private int type;

    private double base;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public double getBase() {
        return base;
    }

    public void setBase(double base) {
        this.base = base;
    }

    public double getAmount(){
        switch (getType()){
            case MANAGER: return base * 100;
            case ENGINEER: return base * 0.01;
            case SALESMAN: return base * 1;
            default: throw new RuntimeException("not find Employee type");
        }
    }
}
